//分享功能
window._bd_share_config = {
			"common": {
				"bdSnsKey": {},
				"bdText": "",
				"bdMini": "1",
				"bdMiniList": false,
				"bdPic": "",
				"bdStyle": "0",
				"bdSize": "16"
			},
			"share": {}
		};
		with(document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];

//菜单栏
$(function($) {
	$('#menu').leftMenu({
		"triggerBtn": ".menu"
	}).init()
})

$("#message").submit(function(e) {
	e.preventDefault()
	var telReg = /^1[35789]\d{9}$/
	if($("#message #name").val() == "") {
		layer.msg("请您输入姓名")
		$("#message #name").focus()
	} else if(!telReg.test($("#message #cellphone").val())) {
		layer.msg("请您输入有效的电话号码")
		$("#message #cellphone").focus()
		return false
	} else if($("#message #location").val() == "") {
		layer.msg("请您输入地址")
		$("#message #location").focus()
		return false
	} else if($("#message #textarea").val() == "") {
		layer.msg("请您输入留言")
		$("#message #textarea").focus()
	} else if($("#message #code").val() == "") {
		layer.msg("请您输入正确的验证码")
		$("#message #code").focus()
		return false
	} else {
		layer.msg("提交完成")
	}
})

//左边二级目录显示隐藏
$(".subNav").on("click", function() {
	$(this).next("ul").slideToggle(300).siblings("ul").slideUp(500);
})

//在招职位
$(".job-vacancy-content").on("click", function() {
	$(this).next(".job-vacancy-info").slideToggle(300).siblings(".job-vacancy-info").slideUp(500);
	if ($(this).hasClass("active")){
		$(this).removeClass("active");
	} else{
		$(this).addClass("active");
		$(this).siblings(".job-vacancy-content").removeClass("active");
	}
})

//下拉菜单
$(".list-nav-first > a").on("click", function() {
	$(this).parent(".list-nav-first").find(".list-nav-second").slideToggle();
	if($(this).parent(".list-nav-first").hasClass("active")){
		$(this).parent(".list-nav-first").removeClass("active");
	}else{
		$(this).parent(".list-nav-first").addClass("active");
	}
})
$(".list-nav-second > a").on("click", function() {
	$(this).parent(".list-nav-second").find(".list-nav-third").slideToggle();
})

var lunbo2 = new Swiper('#lunbo2', {
	direction: 'horizontal', // 垂直切换选项vertical
	loop: true, // 循环模式选项
	autoplay: true,
	paginationClickable: true,

	// 如果需要分页器
	pagination: {
		el: '.swiper-pagination',
		clickable: true
	},
})

var lunbo1 = new Swiper('#lunbo1', {
	direction: 'horizontal', // 垂直切换选项vertical
	loop: true, // 循环模式选项
	autoplay: true,
	paginationClickable: true,

	// 如果需要分页器
	pagination: {
		el: '.swiper-pagination',
		clickable: true
	},
})

//鼠标覆盖停止自动切换
lunbo1.el.onmouseover = function() {
	lunbo1.autoplay.stop();
}

//鼠标移开开始自动切换
lunbo1.el.onmouseleave = function() {
	lunbo1.autoplay.start();
}

var medical = new Swiper('#medical', {
	slidesPerView: 2,
	spaceBetween: 2,
	loop: true,
	autoplay: true,
	navigation: {
		nextEl: '.swiper-button-next',
		prevEl: '.swiper-button-prev',
	},
});
//var prependNumber = 1;
var apparatus = new Swiper('#apparatus', {
	slidesPerView: 3,
	spaceBetween: 2,
	loop: true,
	autoplay: true,
	navigation: {
		nextEl: '.swiper-button-next',
		prevEl: '.swiper-button-prev',
	},
});
//document.querySelector('.prepend-2-slides').addEventListener('click', function(e) {
//	e.preventDefault();
//	swiper.prependSlide([
//		'<div class="swiper-slide">Slide ' + (--prependNumber) + '</div>',
//		'<div class="swiper-slide">Slide ' + (--prependNumber) + '</div>'
//	]);
//});
//document.querySelector('.prepend-slide').addEventListener('click', function(e) {
//	e.preventDefault();
//	swiper.prependSlide('<div class="swiper-slide">Slide ' + (--prependNumber) + '</div>');
//});
//document.querySelector('.append-slide').addEventListener('click', function(e) {
//	e.preventDefault();
//	swiper.appendSlide('<div class="swiper-slide">Slide ' + (++appendNumber) + '</div>');
//});
//document.querySelector('.append-2-slides').addEventListener('click', function(e) {
//	e.preventDefault();
//	swiper.appendSlide([
//		'<div class="swiper-slide">Slide ' + (++appendNumber) + '</div>',
//		'<div class="swiper-slide">Slide ' + (++appendNumber) + '</div>'
//	]);
//});